import React, { useEffect } from 'react';
import * as echarts from 'echarts';
import './count.scss'
interface Props{

}
function Countentry(props: Props) {
    var myChart1: any = null;
    var myChart2: any = null;
 
     useEffect(() => {

        myChart1 = echarts.init(document.getElementById('hh1') || document.body)
        myChart2 = echarts.init(document.getElementById('hh2') || document.body)
      
      
        draw()
    }, [])
     var draw:any = () => {
        myChart1.setOption({
            tooltip: {
                trigger: 'axis',
                axisPointer: {
                    type: 'shadow'
                }
            },
            grid: {
                left: '3%',
                right: '4%',
                bottom: '3%',
                containLabel: true
            },
            xAxis: [
                {
                    type: 'category',
                    data: ['全职', '兼职', '劳务派遣', '临时工', '实习'],
                    axisTick: {
                        alignWithLabel: true
                    }
                }
            ],
            yAxis: [
                {
                    type: 'value'
                }
            ],
            series: [
                {
                    name: 'Direct',
                    type: 'bar',
                    barWidth: '40%',
                    data: [10, 52,  390, 330, 220]
                }
            ]
        }

        ),
        myChart2.setOption({
            tooltip: {
                trigger: 'axis',
                axisPointer: {
                    type: 'shadow'
                }
            },
            grid: {
                left: '3%',
                right: '4%',
                bottom: '3%',
                containLabel: true
            },
            xAxis: [
                {
                    type: 'category',
                    data: ['大专', '本科', '硕士', '博士', '博士以上'],
                    axisTick: {
                        alignWithLabel: true
                    }
                }
            ],
            yAxis: [
                {
                    type: 'value'
                }
            ],
            series: [
                {
                    name: 'Direct',
                    type: 'bar',
                    barWidth: '40%',
                    data: [110, 520, 200, 334, 90]
                }
            ]
        }

        )
    }
    return (
        <div className='count-entry'>
            <p className='title'>入职员工分析</p>
            
            <div style={{display:'flex',justifyContent:'space-between'}}>
            <div id='hh1' style={{ width: 600, height: 600 }}></div>
            <div id='hh2' style={{ width: 600, height: 600 }}></div>
            </div>
            
            
        </div>
    );
}

export default Countentry;